package router

import (
	"github.com/gin-gonic/gin"
	"go_pure_admin_api/controllers"
)

func RoleRoutes() {
	RegisterRoute(func(rgPublic *gin.RouterGroup, rgAuth *gin.RouterGroup) {
		role := controllers.RoleController{}
		//rgPublicRole := rgPublic.Group("role").Use(func() gin.HandlerFunc {
		//	return func(ctx *gin.Context) {
		//		// 这里可以添加公开的路由中间件
		//	}
		//}())
		//{
		//

		//}

		rgAuthRole := rgAuth.Group("role")
		{
			rgAuthRole.POST("/roleList", role.GetRolesList)
			rgAuthRole.POST("/role-menu", role.GetRoleMenu)
			rgAuthRole.POST("/role-menu-ids", role.GetRoleMenuIds)
			rgAuthRole.POST("/updateRole", role.UpdateRole)
			rgAuthRole.POST("/createRole", role.CreateRole)
			rgAuthRole.POST("/updateRoleMenu", role.UpdateRoleMenu)
			rgAuthRole.POST("/deleteRole", role.DeleteRole)
		}
	})
}
